package leetcode.editor.cn;

/**
 * @author: yangwk
 * @date: 2022/12/28
 * @description:
 **/
public class P453 {
    public static void main(String[] args) {
        int[] nums = {1, 2, 3};
        System.out.println(minMoves(nums));
    }

    public static int minMoves(int[] nums) {
        int min = nums[0];
        for (int num : nums) {
            min = Math.min(min, num);
        }
        int sum = 0;
        for (int num : nums) {
            sum += num - min;
        }
        return sum;
    }
}
